//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package nccloud.web.gl.reckoning.action;

import java.util.Map;

import nc.bs.framework.common.InvocationInfoProxy;
import nc.vo.ml.NCLangRes4VoTransl;
import nc.vo.pub.BusinessException;
import nccloud.framework.core.exception.ExceptionUtils;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.json.JsonFactory;
import nccloud.pubitf.gl.lightgl.reckoning.ISettleWebService;

public class ReckoningAction implements ICommonAction {
    public ReckoningAction() {
    }

    public Object doAction(IRequest request) {
        String json = request.read();
        Map<String, Object> varMap = (Map)JsonFactory.create().fromJson(json, Map.class);

        try {
            String year = (String)varMap.get("year");
            String period = (String)varMap.get("period");
            InvocationInfoProxy.getInstance().setProperty("skipDefCheck",varMap.get("skipDefCheck")+"");
            if (varMap.get("moduleid") != null) {
                if ("2002".equals(varMap.get("moduleid"))) {
                    return ((ISettleWebService)ServiceLocator.find(ISettleWebService.class)).reckoning((String)varMap.get("pk_accountingbook"), year, period);
                } else {
                    throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("20021510", "UPP20021510-000031"));
                }
            } else {
                return ((ISettleWebService)ServiceLocator.find(ISettleWebService.class)).reckoning((String)varMap.get("pk_accountingbook"), year, period);
            }
        } catch (Exception var6) {
            Exception e = var6;
            ExceptionUtils.wrapException(e);
            return null;
        }
    }
}
